﻿<!--***********************************************************************************

   Extended WPF Toolkit

   Copyright (C) 2007-2013 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at http://xceed.com/wpf_toolkit

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  **********************************************************************************-->

<ResourceDictionary x:Class="Xceed.Wpf.DataGrid.GenericContentTemplateSelectorResources"
                    x:ClassModifier="internal"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Xceed.Wpf.DataGrid"
                    xmlns:conv="clr-namespace:Xceed.Wpf.DataGrid.Converters"
                    xmlns:s="clr-namespace:System;assembly=mscorlib">

   <conv:ImageConverter x:Key="imageConverter" />
   <conv:NullToBooleanConverter x:Key="nullToBooleanConverter" />

   <DataTemplate x:Key="imageDefaultContentTemplate">

      <Image Source="{Binding Converter={StaticResource imageConverter}, Mode=OneWay}" />

   </DataTemplate>

   <DataTemplate x:Key="booleanDefaultContentTemplate">

      <CheckBox IsHitTestVisible="False"
                IsChecked="{Binding Mode=OneWay}" />

   </DataTemplate>

   <DataTemplate x:Key="foreignKeyDefaultContentTemplate">

      <!-- Binding to the properties of the Cell's ParentColumn-->
      <local:ForeignKeyContentControl Key="{Binding Mode=OneWay}"
                                      ForeignKeyConfiguration="{Binding RelativeSource={RelativeSource self}, Path=(local:Cell.ParentCell).ParentColumn.ForeignKeyConfiguration, Mode=OneWay}"
                                      ContentTemplate="{Binding RelativeSource={RelativeSource self}, Path=(local:Cell.ParentCell).ParentColumn.CellContentTemplate, Mode=OneWay}"
                                      ContentTemplateSelector="{Binding RelativeSource={RelativeSource self}, Path=(local:Cell.ParentCell).ParentColumn.CellContentTemplateSelector, Mode=OneWay}" />

   </DataTemplate>

   <DataTemplate x:Key="foreignKeyGroupValueDefaultContentTemplate">

      <local:ForeignKeyGroupContentControl />

   </DataTemplate>

   <DataTemplate x:Key="foreignKeyScrollTipDefaultContentTemplate">

      <!-- Bind to the properties on MainColumn of the ScrollTip DataGridContext -->
      <local:ForeignKeyScrollTipContentControl Key="{Binding Mode=OneWay}"
                                               ForeignKeyConfiguration="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).Columns.MainColumn.ForeignKeyConfiguration, Mode=OneWay}" />

   </DataTemplate>

   <DataTemplate x:Key="commonDefaultContentTemplate">

      <TextBlock Text="{Binding Mode=OneWay}" />

   </DataTemplate>

</ResourceDictionary>
